﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

namespace MvdDonk.Bomberman.Managers
{
    class GameStateManager 
    {
        //GameState debugState;
        //Stack<GameState> stateStack;

        //internal Stack<GameState> StateStack
        //{
        //    get { return stateStack; }
        //    set { stateStack = value; }
        //}

        //public GameStateManager()
        //{
        //    stateStack = new Stack<GameState>();
        //    Push(new MainMenu());
        //    debugState = new DebugState();
        //    debugState.Owner = this;
        //    debugState.Initilize();
        //}

        //internal GameState DebugState
        //{
        //    get { return debugState; }
        //    set { debugState = value; }
        //}

        //public void Push(GameState gameState)
        //{
        //    gameState.Initilize();
        //    gameState.Owner = this;
        //    stateStack.Push(gameState);
        //}

        //public GameState Pop()
        //{
        //    GameState gs;
        //    gs = null;
        //    if (stateStack.Count > 0)
        //    {
        //        gs = stateStack.Pop();
        //    }
        //    return gs;
        //}

        public void Update(GameTime gameTime)
        {
            InputManager input = Bomberman.Instance.InputManager;
            // Allows the game to exit
            //if (input.KeyClicked(Keys.Escape))
            //    Bomberman.Instance.Exit();

            // TODO: Add your update logic here
            //if (input.KeyClicked(Keys.F1))
            //    Bomberman.Instance.NetworkManager.StartServer();

            //if (input.KeyClicked(Keys.F4))
            //    Bomberman.Instance.NetworkManager.JoinServer(Bomberman.Instance.NetworkManager.ServersFound.First());

            //if (stateStack.Count > 0)
            //    stateStack.Peek().Think(gameTime);

            if (input.KeyClicked(Keys.F2))
            {
                //Push(new GameWorld());
            }
            //debugState.Think(gameTime);
        }

        public void Draw()
        {
            //if (stateStack.Count > 0)
            //    stateStack.Peek().Draw();

            //debugState.Draw();
        }


    }
}
